pkgname=firmware-samsung-rossa
pkgver=2
pkgrel=0
_name="Samsung Galaxy Core Prime LTE"
pkgdesc="Firmware for $_name"
url="https://postmarketos.org"
subpackages="$pkgname-wcnss-nv:wcnss_nv"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
source="$pkgname-WCNSS_qcom_wlan_nv.bin.base64::https://pastebin.com/raw/2vBcF82L"

_fwdir="/lib/firmware/postmarketos"

build() {
	base64 -d $pkgname-WCNSS_qcom_wlan_nv.bin.base64 > WCNSS_qcom_wlan_nv.bin
}

package() {
	# parent package is empty
	mkdir -p "$pkgdir"
}

wcnss_nv() {
	pkgdesc="$_name WiFi/BT firmware configuration"
	install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima
}

sha512sums="
e8ed6f0e5fe9789821fd4bf90d682dff7aae6f4fed33f6aa62aabb7ae97bb50e7033d5e2f51ed2308b88fe27313ca4bdfa479a2a5d9c80762b22c4b4fdcc337c  firmware-samsung-rossa-WCNSS_qcom_wlan_nv.bin.base64
"
